<?php
	class Module_content {
		public static function delete($params) {
			Model_Content::delPage($params['page']);
			header('Location: /' . $params['page'] . '.html');
		}

		public static function apply($params) {
			$page = $params['page'];

			Model_Content::setPage(
				$page,
				$params['title'],
				$params['keywords'],
				$params['description'],
				$params['content']
			);

			header('Location: /' . $page . '.html');
		}

		public static function edit($params) {
			$vis = new Visual();

			$vis->assign('page', Model_Content::getPage($params['page']));

			$vis->display('content/edit.twig');

		}

		public static function execute($params) {
			$vis = new Visual();

			$vis->assign('page', Model_Content::getPage($params['page']));

			$vis->display('content.twig');
		}
	}